package com.lcb.jvm;


/**
* @Author: 刘长柏
* @Date: 2021-01-13
* @Description:  测试栈内存溢出
*/
public class StackOverflowTest {

    // JVM设置 ‐Xss128k(默认1M)
    static int count=0;
    static void redo(){
        count++;
        redo();
    }

    public static void main(String[] args) {
            try{
                redo();
            }catch (Throwable t){
                t.printStackTrace();
                System.out.println(count);
            }
    }
}
